//
// Created by longyunbo on 6/23/21.
//

#ifndef ANALYSIS_METHODINFO_H
#define ANALYSIS_METHODINFO_H

#include "../utilties/AccessFlags.h"
#include "CodeAttributeInfo.h"
class InstanceKlass;
#define PropertyBuilderByName(type, name, access_permission)\
access_permission:\
    type m_##name;\
public:\
inline void set##name(type v) {\
    m_##name = v;\
}\
inline type get##name() {\
    return m_##name;\
}\
//class CodeAttributeInfo;

struct MethodInfo {


      InstanceKlass* belongKlass;
      InstanceKlass* getBelongKlass();
      void setBelongKlass( InstanceKlass* value );

      AccessFlags* accessFlags;
      void setAccessFlag( AccessFlags* value );
      AccessFlags* getAccessFlag();

      short nameIndex;
      PropertyBuilderByName(short,nameIndex,public);

      short descriptorIndex;
      PropertyBuilderByName(short,descriptorIndex,public);

      int attributesCount;
      PropertyBuilderByName(int,attributesCount,public);

public:
      CodeAttributeInfo* attributes;
      CodeAttributeInfo* getCodeAttributeInfo();

      CodeAttributeInfo getCodeAttributeItemInfo( int value );


      char* methodName;

      ~MethodInfo();

public:
      void initAttributeContainer();

};


#endif //ANALYSIS_METHODINFO_H
